﻿@model CatalogSettingsModel

@{
    //page title
    ViewBag.Title = T("Admin.Configuration.Settings.Catalog").Text;
    //active menu item (system name)
    Html.SetActiveMenuItemSystemName("Catalog settings");
}

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    <div class="content-header clearfix">
        <h1 class="pull-left">
            @T("Admin.Configuration.Settings.Catalog")
        </h1>
        <div class="pull-right">
            <button type="submit" name="save" class="btn bg-blue">
                <i class="fa fa-floppy-o"></i>
                @T("Admin.Common.Save")
            </button>
        </div>
    </div>

    <div class="content">
        <div class="form-horizontal">
            @Html.Action("ProjectScopeConfiguration", "Setting")
            @Html.Action("Mode", "Setting")
            @Html.ValidationSummary(false)
            <div class="panel-group">

                <div class="panel panel-default">
                    <div class="panel-body">
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.ProductSearchAutoCompleteEnabled_OverrideForProject, model => model.ProductSearchAutoCompleteEnabled, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.ProductSearchAutoCompleteEnabled)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.ProductSearchAutoCompleteEnabled)
                                @Html.ValidationMessageFor(model => model.ProductSearchAutoCompleteEnabled)
                            </div>
                        </div>
                        <div class="form-group advanced-setting" id="pnlProductSearchAutoCompleteNumberOfProducts">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.ProductSearchAutoCompleteNumberOfProducts_OverrideForProject, model => model.ProductSearchAutoCompleteNumberOfProducts, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.ProductSearchAutoCompleteNumberOfProducts)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.ProductSearchAutoCompleteNumberOfProducts)
                                @Html.ValidationMessageFor(model => model.ProductSearchAutoCompleteNumberOfProducts)
                            </div>
                        </div>
                        <div class="form-group advanced-setting" id="pnlShowProductImagesInSearchAutoComplete">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.ShowProductImagesInSearchAutoComplete_OverrideForProject, model => model.ShowProductImagesInSearchAutoComplete, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.ShowProductImagesInSearchAutoComplete)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.ShowProductImagesInSearchAutoComplete)
                                @Html.ValidationMessageFor(model => model.ShowProductImagesInSearchAutoComplete)
                            </div>
                        </div>
                        <div class="form-group advanced-setting">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.ProductSearchTermMinimumLength_OverrideForProject, model => model.ProductSearchTermMinimumLength, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.ProductSearchTermMinimumLength)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.ProductSearchTermMinimumLength)
                                @Html.ValidationMessageFor(model => model.ProductSearchTermMinimumLength)
                            </div>
                        </div>
                        <div class="form-group advanced-setting">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.SearchPageAllowCustomersToSelectPageSize_OverrideForProject, model => model.SearchPageAllowCustomersToSelectPageSize, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.SearchPageAllowCustomersToSelectPageSize)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.SearchPageAllowCustomersToSelectPageSize)
                                @Html.ValidationMessageFor(model => model.SearchPageAllowCustomersToSelectPageSize)
                            </div>
                        </div>
                        <div class="form-group advanced-setting" id="pnlSearchPageProductsPerPage">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.SearchPageProductsPerPage_OverrideForProject, model => model.SearchPageProductsPerPage, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.SearchPageProductsPerPage)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.SearchPageProductsPerPage)
                                @Html.ValidationMessageFor(model => model.SearchPageProductsPerPage)
                            </div>
                        </div>
                        <div class="form-group advanced-setting" id="pnlSearchPagePageSizeOptions">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.ProductsByTagPageSizeOptions_OverrideForProject, model => model.SearchPagePageSizeOptions, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.SearchPagePageSizeOptions)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.SearchPagePageSizeOptions)
                                @Html.ValidationMessageFor(model => model.SearchPagePageSizeOptions)
                            </div>
                        </div>
                    </div>
                    <script type="text/javascript">
                    $(document).ready(function() {
                        $("#@Html.FieldIdFor(model => model.SearchPageAllowCustomersToSelectPageSize)").click(toggleSearchPagePageSize);
                        $("#@Html.FieldIdFor(model => model.ProductSearchAutoCompleteEnabled)").click(toggleProductSearchAutoComplete);

                        toggleSearchPagePageSize();
                        toggleProductSearchAutoComplete();
                    });

                    function toggleSearchPagePageSize() {
                        if ($('#@Html.FieldIdFor(model => model.SearchPageAllowCustomersToSelectPageSize)').is(':checked')) {
                            $('#pnlSearchPageProductsPerPage').hide();
                            $('#pnlSearchPagePageSizeOptions').show();
                        } else {
                            $('#pnlSearchPageProductsPerPage').show();
                            $('#pnlSearchPagePageSizeOptions').hide();
                        }
                    }

                    function toggleProductSearchAutoComplete() {
                        if ($('#@Html.FieldIdFor(model => model.ProductSearchAutoCompleteEnabled)').is(':checked')) {
                            $('#pnlProductSearchAutoCompleteNumberOfProducts').show();
                            $('#pnlShowProductImagesInSearchAutoComplete').show();
                        } else {
                            $('#pnlProductSearchAutoCompleteNumberOfProducts').hide();
                            $('#pnlShowProductImagesInSearchAutoComplete').hide();
                        }
                    }
                    </script>
                </div>

                <div class="panel panel-default">
                    <div class="panel-body">
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.ProductReviewsMustBeApproved_OverrideForProject, model => model.ProductReviewsMustBeApproved, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.ProductReviewsMustBeApproved)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.ProductReviewsMustBeApproved)
                                @Html.ValidationMessageFor(model => model.ProductReviewsMustBeApproved)
                            </div>
                        </div>
                        <div class="form-group advanced-setting">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.AllowAnonymousUsersToReviewProduct_OverrideForProject, model => model.AllowAnonymousUsersToReviewProduct, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.AllowAnonymousUsersToReviewProduct)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.AllowAnonymousUsersToReviewProduct)
                                @Html.ValidationMessageFor(model => model.AllowAnonymousUsersToReviewProduct)
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.NotifyProjectOwnerAboutNewProductReviews_OverrideForProject, model => model.NotifyProjectOwnerAboutNewProductReviews, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.NotifyProjectOwnerAboutNewProductReviews)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.NotifyProjectOwnerAboutNewProductReviews)
                                @Html.ValidationMessageFor(model => model.NotifyProjectOwnerAboutNewProductReviews)
                            </div>
                        </div>
                        <div class="form-group advanced-setting">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.ShowProductReviewsPerProject_OverrideForProject, model => model.ShowProductReviewsPerProject, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.ShowProductReviewsPerProject)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.ShowProductReviewsPerProject)
                                @Html.ValidationMessageFor(model => model.ShowProductReviewsPerProject)
                            </div>
                        </div>
                        <div class="form-group advanced-setting">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.ShowProductReviewsOnAccountPage_OverrideForProject, model => model.ShowProductReviewsTabOnAccountPage, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.ShowProductReviewsTabOnAccountPage)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.ShowProductReviewsTabOnAccountPage)
                                @Html.ValidationMessageFor(model => model.ShowProductReviewsTabOnAccountPage)
                            </div>
                        </div>
                        <div class="form-group advanced-setting" id="pnlProductReviewsPageSizeOnAccountPage">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.ProductReviewsPageSizeOnAccountPage_OverrideForProject, model => model.ProductReviewsPageSizeOnAccountPage, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.ProductReviewsPageSizeOnAccountPage)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.ProductReviewsPageSizeOnAccountPage)
                                @Html.ValidationMessageFor(model => model.ProductReviewsPageSizeOnAccountPage)
                            </div>
                        </div>
                    </div>
                    <script type="text/javascript">
                $(document).ready(function() {
                    $("#@Html.FieldIdFor(model => model.ShowProductReviewsTabOnAccountPage)").click(toggleProductReviewsPageSizeOnAccountPage);

                    toggleProductReviewsPageSizeOnAccountPage();
                });

                function toggleProductReviewsPageSizeOnAccountPage() {
                    if ($('#@Html.FieldIdFor(model => model.ShowProductReviewsTabOnAccountPage)').is(':checked')) {
                        $('#pnlProductReviewsPageSizeOnAccountPage').show();
                    } else {
                        $('#pnlProductReviewsPageSizeOnAccountPage').hide();
                    }
                }
                    </script>
                </div>

                <div class="panel panel-default advanced-setting">
                    <div class="panel-body">
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.SDFLabelFor(model => model.IgnoreAcl)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.IgnoreAcl)
                                @Html.ValidationMessageFor(model => model.IgnoreAcl)
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.SDFLabelFor(model => model.IgnoreProjectLimitations)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.IgnoreProjectLimitations)
                                @Html.ValidationMessageFor(model => model.IgnoreProjectLimitations)
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.SDFLabelFor(model => model.IgnoreDiscounts)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.IgnoreDiscounts)
                                @Html.ValidationMessageFor(model => model.IgnoreDiscounts)
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.SDFLabelFor(model => model.IgnoreFeaturedProducts)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.IgnoreFeaturedProducts)
                                @Html.ValidationMessageFor(model => model.IgnoreFeaturedProducts)
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.SDFLabelFor(model => model.CacheProductPrices)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.CacheProductPrices)
                                @Html.ValidationMessageFor(model => model.CacheProductPrices)
                            </div>
                        </div>
                    </div>
                </div>

                <div class="panel panel-default">
                    <div class="panel-body">
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.ShowShareButton_OverrideForProject, model => model.ShowShareButton, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.ShowShareButton)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.ShowShareButton)
                                @Html.ValidationMessageFor(model => model.ShowShareButton)
                            </div>
                        </div>
                        <div class="form-group advanced-setting" id="pnlPageShareCode">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.PageShareCode_OverrideForProject, model => model.PageShareCode, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.PageShareCode)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFTextAreaFor(model => model.PageShareCode)
                                @Html.ValidationMessageFor(model => model.PageShareCode)
                            </div>
                        </div>
                        <script type="text/javascript">
                            $(document).ready(function() {
                                $("#@Html.FieldIdFor(model => model.ShowShareButton)").click(togglePageShareCode);
                                togglePageShareCode();
                            });

                            function togglePageShareCode() {
                                if ($('#@Html.FieldIdFor(model => model.ShowShareButton)').is(':checked')) {
                                    $('#pnlPageShareCode').show();
                                } else {
                                    $('#pnlPageShareCode').hide();
                                }
                            }
                        </script>
                    </div>
                </div>

                <div class="panel panel-default">
                    <div class="panel-body">
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.CompareProductsEnabled_OverrideForProject, model => model.CompareProductsEnabled, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.CompareProductsEnabled)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.CompareProductsEnabled)
                                @Html.ValidationMessageFor(model => model.CompareProductsEnabled)
                            </div>
                        </div>
                        <div class="form-group advanced-setting" id="pnlIncludeShortDescriptionInCompareProducts">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.IncludeShortDescriptionInCompareProducts_OverrideForProject, model => model.IncludeShortDescriptionInCompareProducts, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.IncludeShortDescriptionInCompareProducts)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.IncludeShortDescriptionInCompareProducts)
                                @Html.ValidationMessageFor(model => model.IncludeShortDescriptionInCompareProducts)
                            </div>
                        </div>
                        <div class="form-group advanced-setting" id="IncludeFullDescriptionInCompareProducts">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.IncludeFullDescriptionInCompareProducts_OverrideForProject, model => model.IncludeFullDescriptionInCompareProducts, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.IncludeFullDescriptionInCompareProducts)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.IncludeFullDescriptionInCompareProducts)
                                @Html.ValidationMessageFor(model => model.IncludeFullDescriptionInCompareProducts)
                            </div>
                        </div>
                        <script type="text/javascript">
                            $(document).ready(function() {
                                $("#@Html.FieldIdFor(model => model.CompareProductsEnabled)").click(toggleCompareProductsEnabled);
                                toggleCompareProductsEnabled();
                            });

                            function toggleCompareProductsEnabled() {
                                if ($('#@Html.FieldIdFor(model => model.CompareProductsEnabled)').is(':checked')) {
                                    $('#pnlIncludeShortDescriptionInCompareProducts').show();
                                    $('#IncludeFullDescriptionInCompareProducts').show();
                                } else {
                                    $('#pnlIncludeShortDescriptionInCompareProducts').hide();
                                    $('#IncludeFullDescriptionInCompareProducts').hide();
                                }
                            }
                        </script>
                    </div>
                </div>

                <div class="panel panel-default">
                    <div class="panel-body">
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.ShowBestsellersOnHomepage_OverrideForProject, model => model.ShowBestsellersOnHomepage, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.ShowBestsellersOnHomepage)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.ShowBestsellersOnHomepage)
                                @Html.ValidationMessageFor(model => model.ShowBestsellersOnHomepage)
                            </div>
                        </div>
                        <div class="form-group advanced-setting" id="pnlNumberOfBestsellersOnHomepage">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.NumberOfBestsellersOnHomepage_OverrideForProject, model => model.NumberOfBestsellersOnHomepage, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.NumberOfBestsellersOnHomepage)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.NumberOfBestsellersOnHomepage)
                                @Html.ValidationMessageFor(model => model.NumberOfBestsellersOnHomepage)
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.ProductsAlsoPurchasedEnabled_OverrideForProject, model => model.ProductsAlsoPurchasedEnabled, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.ProductsAlsoPurchasedEnabled)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.ProductsAlsoPurchasedEnabled)
                                @Html.ValidationMessageFor(model => model.ProductsAlsoPurchasedEnabled)
                            </div>
                        </div>
                        <div class="form-group advanced-setting" id="pnlProductsAlsoPurchasedNumber">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.ProductsAlsoPurchasedNumber_OverrideForProject, model => model.ProductsAlsoPurchasedNumber, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.ProductsAlsoPurchasedNumber)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.ProductsAlsoPurchasedNumber)
                                @Html.ValidationMessageFor(model => model.ProductsAlsoPurchasedNumber)
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.EmailAFriendEnabled_OverrideForProject, model => model.EmailAFriendEnabled, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.EmailAFriendEnabled)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.EmailAFriendEnabled)
                                @Html.ValidationMessageFor(model => model.EmailAFriendEnabled)
                            </div>
                        </div>
                        <div class="form-group advanced-setting" id="pnlAllowAnonymousUsersToEmailAFriend">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.AllowAnonymousUsersToEmailAFriend_OverrideForProject, model => model.AllowAnonymousUsersToEmailAFriend, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.AllowAnonymousUsersToEmailAFriend)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.AllowAnonymousUsersToEmailAFriend)
                                @Html.ValidationMessageFor(model => model.AllowAnonymousUsersToEmailAFriend)
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.ShowProductSku_OverrideForProject, model => model.ShowProductSku, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.ShowProductSku)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.ShowProductSku)
                                @Html.ValidationMessageFor(model => model.ShowProductSku)
                            </div>
                        </div>
                        <div class="form-group advanced-setting">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.ShowGtin_OverrideForProject, model => model.ShowGtin, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.ShowGtin)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.ShowGtin)
                                @Html.ValidationMessageFor(model => model.ShowGtin)
                            </div>
                        </div>
                        <div class="form-group advanced-setting">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.ShowManufacturerPartNumber_OverrideForProject, model => model.ShowManufacturerPartNumber, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.ShowManufacturerPartNumber)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.ShowManufacturerPartNumber)
                                @Html.ValidationMessageFor(model => model.ShowManufacturerPartNumber)
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.RecentlyViewedProductsEnabled_OverrideForProject, model => model.RecentlyViewedProductsEnabled, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.RecentlyViewedProductsEnabled)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.RecentlyViewedProductsEnabled)
                                @Html.ValidationMessageFor(model => model.RecentlyViewedProductsEnabled)
                            </div>
                        </div>
                        <div class="form-group advanced-setting" id="pnlRecentlyViewedProductsNumber">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.RecentlyViewedProductsNumber_OverrideForProject, model => model.RecentlyViewedProductsNumber, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.RecentlyViewedProductsNumber)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.RecentlyViewedProductsNumber)
                                @Html.ValidationMessageFor(model => model.RecentlyViewedProductsNumber)
                            </div>
                        </div>
                        <div class="form-group advanced-setting">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.ShowFreeShippingNotification_OverrideForProject, model => model.ShowFreeShippingNotification, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.ShowFreeShippingNotification)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.ShowFreeShippingNotification)
                                @Html.ValidationMessageFor(model => model.ShowFreeShippingNotification)
                            </div>
                        </div>
                        <div class="form-group advanced-setting">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.AllowProductViewModeChanging_OverrideForProject, model => model.AllowProductViewModeChanging, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.AllowProductViewModeChanging)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.AllowProductViewModeChanging)
                                @Html.ValidationMessageFor(model => model.AllowProductViewModeChanging)
                            </div>
                        </div>
                        <div class="form-group advanced-setting">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.AllowViewUnpublishedProductPage_OverrideForProject, model => model.AllowViewUnpublishedProductPage, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.AllowViewUnpublishedProductPage)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.AllowViewUnpublishedProductPage)
                                @Html.ValidationMessageFor(model => model.AllowViewUnpublishedProductPage)
                            </div>
                        </div>
                        <div class="form-group advanced-setting">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.DisplayDiscontinuedMessageForUnpublishedProducts_OverrideForProject, model => model.DisplayDiscontinuedMessageForUnpublishedProducts, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.DisplayDiscontinuedMessageForUnpublishedProducts)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.DisplayDiscontinuedMessageForUnpublishedProducts)
                                @Html.ValidationMessageFor(model => model.DisplayDiscontinuedMessageForUnpublishedProducts)
                            </div>
                        </div>
                        <div class="form-group advanced-setting">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.ShowProductsFromSubcategories_OverrideForProject, model => model.ShowProductsFromSubcategories, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.ShowProductsFromSubcategories)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.ShowProductsFromSubcategories)
                                @Html.ValidationMessageFor(model => model.ShowProductsFromSubcategories)
                            </div>
                        </div>
                        <div class="form-group advanced-setting">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.ShowCategoryProductNumber_OverrideForProject, model => model.ShowCategoryProductNumber, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.ShowCategoryProductNumber)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.ShowCategoryProductNumber)
                                @Html.ValidationMessageFor(model => model.ShowCategoryProductNumber)
                            </div>
                        </div>
                        <div class="form-group advanced-setting" id="pnlShowCategoryProductNumberIncludingSubcategories">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.ShowCategoryProductNumberIncludingSubcategories_OverrideForProject, model => model.ShowCategoryProductNumberIncludingSubcategories, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.ShowCategoryProductNumberIncludingSubcategories)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.ShowCategoryProductNumberIncludingSubcategories)
                                @Html.ValidationMessageFor(model => model.ShowCategoryProductNumberIncludingSubcategories)
                            </div>
                        </div>
                        <div class="form-group advanced-setting">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.CategoryBreadcrumbEnabled_OverrideForProject, model => model.CategoryBreadcrumbEnabled, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.CategoryBreadcrumbEnabled)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.CategoryBreadcrumbEnabled)
                                @Html.ValidationMessageFor(model => model.CategoryBreadcrumbEnabled)
                            </div>
                        </div>
                        <div class="form-group advanced-setting">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.NewProductsEnabled_OverrideForProject, model => model.NewProductsEnabled, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.NewProductsEnabled)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.NewProductsEnabled)
                                @Html.ValidationMessageFor(model => model.NewProductsEnabled)
                            </div>
                        </div>
                        <div class="form-group advanced-setting" id="pnlNewProductsNumber">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.NewProductsNumber_OverrideForProject, model => model.NewProductsNumber, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.NewProductsNumber)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.NewProductsNumber)
                                @Html.ValidationMessageFor(model => model.NewProductsNumber)
                            </div>
                        </div>
                        <div class="form-group advanced-setting">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.NumberOfProductTags_OverrideForProject, model => model.NumberOfProductTags, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.NumberOfProductTags)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.NumberOfProductTags)
                                @Html.ValidationMessageFor(model => model.NumberOfProductTags)
                            </div>
                        </div>
                        <div class="form-group advanced-setting">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.ProductsByTagAllowCustomersToSelectPageSize_OverrideForProject, model => model.ProductsByTagAllowCustomersToSelectPageSize, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.ProductsByTagAllowCustomersToSelectPageSize)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.ProductsByTagAllowCustomersToSelectPageSize)
                                @Html.ValidationMessageFor(model => model.ProductsByTagAllowCustomersToSelectPageSize)
                            </div>
                        </div>
                        <div class="form-group advanced-setting" id="pnlProductsByTagPageSize">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.ProductsByTagPageSize_OverrideForProject, model => model.ProductsByTagPageSize, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.ProductsByTagPageSize)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.ProductsByTagPageSize)
                                @Html.ValidationMessageFor(model => model.ProductsByTagPageSize)
                            </div>
                        </div>
                        <div class="form-group advanced-setting" id="pnlProductsByTagPageSizeOptions">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.ProductsByTagPageSizeOptions_OverrideForProject, model => model.ProductsByTagPageSizeOptions, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.ProductsByTagPageSizeOptions)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.ProductsByTagPageSizeOptions)
                                @Html.ValidationMessageFor(model => model.ProductsByTagPageSizeOptions)
                            </div>
                        </div>
                        <div class="form-group advanced-setting">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.ManufacturersBlockItemsToDisplay_OverrideForProject, model => model.ManufacturersBlockItemsToDisplay, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.ManufacturersBlockItemsToDisplay)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.ManufacturersBlockItemsToDisplay)
                                @Html.ValidationMessageFor(model => model.ManufacturersBlockItemsToDisplay)
                            </div>
                        </div>
                    </div>

                    <script type="text/javascript">
                        $(document).ready(function() {
                            $("#@Html.FieldIdFor(model => model.ShowCategoryProductNumber)").click(toggleShowCategoryProductNumberIncludingSubcategories);
                            $("#@Html.FieldIdFor(model => model.EmailAFriendEnabled)").click(toggleEmailAFriend);
                            $("#@Html.FieldIdFor(model => model.RecentlyViewedProductsEnabled)").click(toggleRecentlyViewedProducts);
                            $("#@Html.FieldIdFor(model => model.NewProductsEnabled)").click(toggleNewProducts);
                            $("#@Html.FieldIdFor(model => model.ShowBestsellersOnHomepage)").click(toggleBestsellersOnHomepage);
                            $("#@Html.FieldIdFor(model => model.ProductsAlsoPurchasedEnabled)").click(toggleProductsAlsoPurchasedNumber);
                            $("#@Html.FieldIdFor(model => model.ProductsByTagAllowCustomersToSelectPageSize)").click(toggleProductsByTagPageSize);

                            toggleShowCategoryProductNumberIncludingSubcategories();
                            toggleEmailAFriend();
                            toggleRecentlyViewedProducts();
                            toggleNewProducts();
                            toggleBestsellersOnHomepage();
                            toggleProductsAlsoPurchasedNumber();
                            toggleProductsByTagPageSize();
                        });

                        function toggleShowCategoryProductNumberIncludingSubcategories() {
                            if ($('#@Html.FieldIdFor(model => model.ShowCategoryProductNumber)').is(':checked')) {
                                $('#pnlShowCategoryProductNumberIncludingSubcategories').show();
                            } else {
                                $('#pnlShowCategoryProductNumberIncludingSubcategories').hide();
                            }
                        }

                        function toggleEmailAFriend() {
                            if ($('#@Html.FieldIdFor(model => model.EmailAFriendEnabled)').is(':checked')) {
                                $('#pnlAllowAnonymousUsersToEmailAFriend').show();
                            } else {
                                $('#pnlAllowAnonymousUsersToEmailAFriend').hide();
                            }
                        }

                        function toggleRecentlyViewedProducts() {
                            if ($('#@Html.FieldIdFor(model => model.RecentlyViewedProductsEnabled)').is(':checked')) {
                                $('#pnlRecentlyViewedProductsNumber').show();
                            } else {
                                $('#pnlRecentlyViewedProductsNumber').hide();
                            }
                        }

                        function toggleNewProducts() {
                            if ($('#@Html.FieldIdFor(model => model.NewProductsEnabled)').is(':checked')) {
                                $('#pnlNewProductsNumber').show();
                            } else {
                                $('#pnlNewProductsNumber').hide();
                            }
                        }

                        function toggleBestsellersOnHomepage() {
                            if ($('#@Html.FieldIdFor(model => model.ShowBestsellersOnHomepage)').is(':checked')) {
                                $('#pnlNumberOfBestsellersOnHomepage').show();
                            } else {
                                $('#pnlNumberOfBestsellersOnHomepage').hide();
                            }
                        }

                        function toggleProductsAlsoPurchasedNumber() {
                            if ($('#@Html.FieldIdFor(model => model.ProductsAlsoPurchasedEnabled)').is(':checked')) {
                                $('#pnlProductsAlsoPurchasedNumber').show();
                            } else {
                                $('#pnlProductsAlsoPurchasedNumber').hide();
                            }
                        }

                        function toggleProductsByTagPageSize() {
                            if ($('#@Html.FieldIdFor(model => model.ProductsByTagAllowCustomersToSelectPageSize)').is(':checked')) {
                                $('#pnlProductsByTagPageSize').hide();
                                $('#pnlProductsByTagPageSizeOptions').show();
                            } else {
                                $('#pnlProductsByTagPageSize').show();
                                $('#pnlProductsByTagPageSizeOptions').hide();
                            }
                        }

                    </script>
                </div>

                <div class="panel panel-default advanced-setting">
                    <div class="panel-body">

                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.DisplayTaxShippingInfoFooter_OverrideForProject, model => model.DisplayTaxShippingInfoFooter, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.DisplayTaxShippingInfoFooter)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.DisplayTaxShippingInfoFooter)
                                @Html.ValidationMessageFor(model => model.DisplayTaxShippingInfoFooter)
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.DisplayTaxShippingInfoProductDetailsPage_OverrideForProject, model => model.DisplayTaxShippingInfoProductDetailsPage, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.DisplayTaxShippingInfoProductDetailsPage)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.DisplayTaxShippingInfoProductDetailsPage)
                                @Html.ValidationMessageFor(model => model.DisplayTaxShippingInfoProductDetailsPage)
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.DisplayTaxShippingInfoProductBoxes_OverrideForProject, model => model.DisplayTaxShippingInfoProductBoxes, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.DisplayTaxShippingInfoProductBoxes)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.DisplayTaxShippingInfoProductBoxes)
                                @Html.ValidationMessageFor(model => model.DisplayTaxShippingInfoProductBoxes)
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.DisplayTaxShippingInfoShoppingCart_OverrideForProject, model => model.DisplayTaxShippingInfoShoppingCart, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.DisplayTaxShippingInfoShoppingCart)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.DisplayTaxShippingInfoShoppingCart)
                                @Html.ValidationMessageFor(model => model.DisplayTaxShippingInfoShoppingCart)
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.DisplayTaxShippingInfoWishlist_OverrideForProject, model => model.DisplayTaxShippingInfoWishlist, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.DisplayTaxShippingInfoWishlist)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.DisplayTaxShippingInfoWishlist)
                                @Html.ValidationMessageFor(model => model.DisplayTaxShippingInfoWishlist)
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.DisplayTaxShippingInfoOrderDetailsPage_OverrideForProject, model => model.DisplayTaxShippingInfoOrderDetailsPage, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.DisplayTaxShippingInfoOrderDetailsPage)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.DisplayTaxShippingInfoOrderDetailsPage)
                                @Html.ValidationMessageFor(model => model.DisplayTaxShippingInfoOrderDetailsPage)
                            </div>
                        </div>
                    </div>
                </div>
                
                <div class="panel panel-default advanced-setting">
                    <div class="panel-body">

                        <div class="form-group advanced-setting">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.ExportImportProductAttributes_OverrideForProject, model => model.ExportImportProductAttributes, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.ExportImportProductAttributes)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.ExportImportProductAttributes)
                                @Html.ValidationMessageFor(model => model.ExportImportProductAttributes)
                            </div>
                        </div>
                    </div>
                </div>

                <div class="panel panel-default advanced-setting">
                    <div class="panel-body">
                        
                        <div class="form-group advanced-setting">
                            <div class="col-md-3">
                                @Html.OverrideProjectCheckboxFor(model => model.AllowProductSorting_OverrideForProject, model => model.AllowProductSorting, Model.ActiveProjectScopeConfiguration)
                                @Html.SDFLabelFor(model => model.AllowProductSorting)
                            </div>
                            <div class="col-md-9">
                                @Html.SDFEditorFor(model => model.AllowProductSorting)
                                @Html.ValidationMessageFor(model => model.AllowProductSorting)
                            </div>
                        </div>
                        <div id="sortoptions-grid"></div>

                        <script>
                            $(document).ready(function() {
                                $("#sortoptions-grid").kendoGrid({
                                    dataSource: {
                                        type: "json",
                                        transport: {
                                            read: {
                                                url: "@Html.Raw(Url.Action("SortOptionsList", "Setting"))",
                                                type: "POST",
                                                dataType: "json",
                                                data: addAntiForgeryToken
                                            },
                                            update: {
                                                url: "@Html.Raw(Url.Action("SortOptionUpdate", "Setting"))",
                                                type: "POST",
                                                dataType: "json",
                                                data: addAntiForgeryToken
                                            }
                                        },
                                        schema: {
                                            data: "Data",
                                            total: "Total",
                                            errors: "Errors",
                                            model: {
                                                id: "Id",
                                                fields: {
                                                    Name: { editable: false, type: "string" },
                                                    DisplayOrder: { editable: true, type: "number" },
                                                    IsActive: { editable: true, type: "boolean" }
                                                }
                                            }
                                        },
                                        requestEnd: function(e) {
                                            if (e.type == "update") {
                                                this.read();
                                            }
                                        },
                                        error: function(e) {
                                            display_kendoui_grid_error(e);
                                            // Cancel the changes
                                            this.cancelChanges();
                                        },
                                        serverPaging: true,
                                        serverFiltering: true,
                                        serverSorting: true
                                    },
                                    pageable: {
                                        refresh: true,
                                        numeric: false,
                                        previousNext: false,
                                        info: false
                                    },
                                    editable: {
                                        confirmation: "@T("Admin.Common.DeleteConfirmation")",
                                        mode: "inline"
                                    },
                                    scrollable: false,
                                    columns: [
                                        {
                                            field: "Name",
                                            title: "@T("Admin.Configuration.Settings.Catalog.SortOptions.Name")",
                                            width: 250
                                        }, {
                                            field: "DisplayOrder",
                                            title: "@T("Admin.Configuration.Settings.Catalog.SortOptions.DisplayOrder")",
                                            //integer format
                                            format: "{0:0}",
                                            width: 100
                                        }, {
                                            field: "IsActive",
                                            title: "@T("Admin.Configuration.Settings.Catalog.SortOptions.IsActive")",
                                            width: 100,
                                            headerAttributes: { style: "text-align:center" },
                                            attributes: { style: "text-align:center" },
                                            template: '# if(IsActive) {# <i class="fa fa-check true-icon"></i> #} else {# <i class="fa fa-close false-icon"></i> #} #'
                                        }, {
                                            command: {
                                                name: "edit",
                                                text: {
                                                    edit: "@T("Admin.Common.Edit")",
                                                    update: "@T("Admin.Common.Update")",
                                                    cancel: "@T("Admin.Common.Cancel")"
                                                }
                                            },
                                            title: "@T("Admin.Common.Edit")",
                                            width: 150
                                        }
                                    ]
                                });
                            });
                        </script>
                    </div>
                </div>
            </div>
        </div>
    </div>
}